// pages/activity/details.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        is_shoucang: 0,
        goods_info: {
            goods_id: 1,
            goods_address: "水磨沟区西虹西路119号（紫罗兰楼内）（紫罗兰楼下）",
            goods_name: '相遇石桥过桥米线',
            goods_yunfei: 0,
            goods_kucun: 100,
            goods_xiaoliang: 1,
            content: '商品介绍详情商品介绍详情商品介绍详情商品介绍详情商品介绍详情商品介绍详情商品介绍详情'
        },
        goods_img: [{
            'img': '../image/shangjia.jpg'
        },
        {
            'img': '../image/shangjia.jpg'
        },
        {
            'img': '../image/shangjia.jpg'
        },
        {
            'img': '../image/shangjia.jpg'
        },
        ],
        indicatorDots: true,
        autoplay: true,
        interval: 5000,
        duration: 1000,
        pjDataList: [{
            headpic: '../image/touxiang.jpg',
            author: '张三',
            add_time: '2018-06-01',
            content: '好评好评，真实太好了!'
        },
        {
            headpic: '../image/touxiang.jpg',
            author: '张三',
            add_time: '2018-06-01',
            content: '好评好评，真实太好了!'
        }
        ], //评价数据

        con: [
            {
                "image1": "../image/touxiang.jpg",
                "shopName": "内蒙特产套餐—（烤羊腿：1000g/盒*1+内蒙奶酪：450g/盒*1+风干牛肉：500g/袋*2）",
                "price": 1280.00,
                "markPrice": 2256.00
            },
            {
                "image1": "../image/touxiang.jpg",
                "shopName": "老人保健按摩毯",
                "price": 1280.00,
                "markPrice": 2256.00
            },
            {
                "image1": "../image/touxiang.jpg",
                "shopName": "詹姆士公爵干红葡萄酒VCE0137【750ml/瓶*3瓶】",
                "price": 1280.00,
                "markPrice": 2256.00
            },
            {
                "image1": "../image/touxiang.jpg",
                "shopName": "泰国天然乳胶高低颈椎按摩枕（两个）",
                "price": 1280.00,
                "markPrice": 2256.00
            }
        ],
        dataList: [{
            goods_id: 2,
            goods_title: '天山天池1',
            goods_img: '../image/ceshi.jpg',
            goods_xiaoliang: '0',
            goods_price: '60'
        }, {
            goods_id: 2,
            goods_title: '天山天池2',
            goods_img: '../image/ceshi.jpg',
            goods_xiaoliang: '0',
            goods_price: '70'
        }, {
            goods_id: 2,
            goods_title: '天山天池3',
            goods_img: '../image/ceshi.jpg',
            goods_xiaoliang: '0',
            goods_price: '80'
        }, {
            goods_id: 2,
            goods_title: '天山天池4',
            goods_img: '../image/ceshi.jpg',
            goods_xiaoliang: '0',
            goods_price: '90'
        }, {
            goods_id: 2,
            goods_title: '天山天池5',
            goods_img: '../image/ceshi.jpg',
            goods_xiaoliang: '0',
            goods_price: '110'
        }]
    },


    previewImage: function (e) {
        var current = e.target.dataset.src;
        var href = this.data.imghref;
        var goodsimg = this.data.goods_img;
        var imglist = [];
        for (var i = 0; i < goodsimg.length; i++) {
            imglist[i] = href + goodsimg[i].img
        }
        wx.previewImage({
            current: current, // 当前显示图片的http链接  
            urls: imglist // 需要预览的图片http链接列表  
        })
    },


    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var that = this;
        if (this.data.currentTab === 0) {
            return false;
        } else {
            that.setData({
                currentTab: 0,
            })
        }
    },

    clickTab: function (e) {
        var that = this;
        if (this.data.currentTab === e.target.dataset.current) {
            return false;
        } else {
            that.setData({
                currentTab: e.target.dataset.current,
            })
        }
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    },
    shopDec: function () {
        wx.navigateTo({
            url: '../goods/detail/detail?scene=1'
        })
    },
})